array ds hackerrank solution in python